package io.github.talelin.latticy.vo;

import io.github.talelin.latticy.entity.Job;
import io.github.talelin.latticy.entity.Project;
import io.github.talelin.latticy.entity.User;
import lombok.Getter;
import lombok.Setter;
import org.springframework.beans.BeanUtils;

import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.OneToMany;
import javax.persistence.OrderBy;
import java.util.List;
import java.util.stream.Collectors;

@Getter
@Setter
public class TeamJobVO {

    private Long id;
    private String nickname;
    private String avatar;
    private String name;
    private Integer count;
    private List<Job> jobList;

    public TeamJobVO(User user) {
        BeanUtils.copyProperties(user, this);
    }

    public static List<TeamJobVO> getList(List<User> userList) {
        return userList.stream()
                .map(TeamJobVO::new)
                .collect(Collectors.toList());
    }


}
